<%@page contentType="text/html; charset=utf-8"%>
<%@ include file="../inc/TagLibs.jsp"%>
<c:set var="pageTitle" value="上传设计文件" />
<%@ include file="../inc/Title.jsp"%>
<head>
<link rel="stylesheet" type="text/css" href="/css/base.css" />
<link href="/css/Query.css" rel="stylesheet" type="text/css">
<script src="/js/QueryList.js"></script>
<script language="javascript">
	function doShow(id,wcId){
		var url="/business/BusinessBillInfoForAccessory.ihtm?id="+id+"&wc_id="+wcId;
		showWin(900,600,url);
	}
	function DoubleClick(it){
		var ob_arr = document.getElementsByName("query_checkbox");
		var id="",wcId="";
		if (ob_arr.length>=it.getAttribute("index") ){
			id=ob_arr[it.getAttribute("index")-1].value;
			wcId=ob_arr[it.getAttribute("index")-1].getAttribute("wc_id");
		}
		if(id==""){
			return;
		}
		doShow(id,wcId);
	}
	function doSearch(){
		var searchKey=encodeURIComponent(document.getElementById("search_key").value.trim());
		var tsId=document.getElementById("ts_id").value;
		window.location="/business/BusinessBillListForAccessory.ihtm?search_key="+searchKey+"&ts_id="+tsId;
	}
	function doGo(pageIndex){
		var searchKey=encodeURIComponent("${searchKey}");
		var type="${type}";
		window.location="/business/BusinessBillListForAccessory.ihtm?search_key="+searchKey+"&ts_id=${tsId}"+"&current_page="+pageIndex;
	}
	function doJump(pageIndex){
		if(window.event.keyCode==13){
			doGo(pageIndex);
		}
	}
	function doDownload(){
		var searchKey=encodeURIComponent("${searchKey}");
		window.location="/business/BusinessBillListForAccessory.ihtm?search_key="+searchKey+"&ts_id=${tsId}"+"&content_type=EXCEL";
	}
	function doCancel(){
		window.close();
	}
	function doInit(){
		Window_Onload();
		document.getElementById("search_key").focus();
	}
	function checkSearchKey(){
		if(window.event.keyCode==13){
			doSearch();
		}
	}
</script>
</head>
<body oncontextmenu="return false" onLoad="doInit();"  class="sheet" style="text-align:center;">
<div class="sheet-main" style="width:860px;text-align:left;margin:auto;">
  <div class="sheet-top">
    <div class="content">
      <h2>上传设计文件</h2>
      <p>将设计好的文件上传，作为工厂制作的依据。在【系统配置】设置允许上传文件的条件：未审核、已审核未开工</p>
    </div>
  </div>
  <div class="sheet-list">
    <div class="search-business">
      <div class="content">
        <table width="748">
          <tbody>
            <tr>
              <td  align="right">
              	  <select name='ts_id' id="ts_id">
					<option value="0">==请选择账套==</option>
					<c:forEach var="item" items="${tsList}">
					<option value="${item.id}" <c:if test="${tsId==item.id}">selected</c:if>>${item.title}</option>
					</c:forEach>
		  		  </select>
	              <input type="text" class="TextBox" id="search_key" name="search_key" onKeyUp="checkSearchKey();" style="width:100px" value="${searchKey}" title="以客户名称、客户拼单字头、摘要、业务单号、设计员进行模糊查询">
	              <input type="button" class="buttom search-but" value=" 查 询" onClick="doSearch();" title="以客户名称、客户拼单字头、摘要、业务单号、设计员进行模糊查询">
				</td>
            </tr>    
           </tbody>      
        </table>
      </div>
	  <%@include file="../inc/AlertMsg.jsp"%>
      <div class="table-list">
        <table width="100%">
			<tr >
				<th  width="14%">单号</th>
				<th  width="9%">订货日期</th>
				<th  width="14%">订货单位</th>
				<th  width="14%">摘要</th>
				<th  width="9%">交货日期</th>
				<th  width="16%">设计员</th>
				<th  width="8%">设计类型</th>
				<th  width="10%">工作中心</th>
				<th  width="6%">操作</th>
			</tr>
			<c:forEach var="item" items="${qr.list}" varStatus="i">
				<c:if test="${(i.index mod 2)==0}"><c:set var="trClass" value="query_list_data_tr1" /></c:if>
				<c:if test="${(i.index mod 2)!=0}"><c:set var="trClass" value="query_list_data_tr2" /></c:if>
				<tr class="${trClass}" index="${i.index+1}" style='cursor:pointer;' ondblclick='javascript:DoubleClick(this)' onClick='javascript:ClickCheck(this)' onmouseout='javascript:mouseout(this)' onmouseover='javascript:mouseover(this)'>
					<td>
						<input type="radio" name='query_checkbox' value="${item[0]}" wc_id="${item[9]}" style="display:none">
						${item[1]}
					</td>
					<td><fmt:formatDate value="${item[2]}" pattern="yyyy-MM-dd"/></td>
					<td>${item[3]}<c:if test="${item[4]!=null && item[4]!=''}">(${item[4]})</c:if></td>
					<td>${item[5]}</td>
					<td>
						<c:if test="${item[6]!=null}">
						<fmt:formatDate value="${item[6]}" pattern="yyyy-MM-dd"/>
						</c:if>
					</td>
					<td>${item[7]}</td>
					<td>
						<c:if test="${item[8]=='CLIENT'}">客户来稿</c:if>
						<c:if test="${item[8]=='SELF'}">公司设计</c:if>
					</td>
					<td><commonTag:showSimpleObjectName list="${wcList}" objectId="${item[9]}" /></td>
					<td>
						<a href="javascript:doShow('${item[0]}','${item[9]}');">上传</a>
					</td>
				</tr>
			</c:forEach>
		</table>
		<%@include file="../inc/Pages.jsp"%>
      </div>
    </div>
  </div>
</div>
</body>
</html>